package com.midou.administration.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.midou.administration.entity.DeskType;
import com.midou.administration.mapper.DeskTypeMapper;
import com.midou.administration.service.DeskTypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author MrChen
 * @since 2021-03-24
 */
@Service
public class DeskTypeServiceImpl implements DeskTypeService {
    @Resource
    private DeskTypeMapper deskTypeMapper;
    @Override
    public List<DeskType> queryDeskType(Integer id) {
        QueryWrapper qw = new QueryWrapper();
        qw.eq("bu_id",id);
        return deskTypeMapper.selectList(qw);
    }


    public List<DeskType> queryAll(){
        return deskTypeMapper.qureyAll();
    }
    public int queryAdd(DeskType deskType){
        return deskTypeMapper.queryAdd(deskType);
    }

    @Override
    public List<DeskType> queryAllByBusiness(int id) {
        //根据商家id查询分类
        QueryWrapper qw = new QueryWrapper();
        qw.eq("bu_id",id);
        List<DeskType> list = this.deskTypeMapper.selectList(qw);
        return list;
    }
}
